package com.hotel.service.Impl;

import com.hotel.entity.Orders;
import com.hotel.mapper.OrdersMapper;
import com.hotel.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 夏智力
 * @FileName OrderServiceImpl
 * @date 2021/6/22 10:42
 * @Software: IntelliJ IDEA
 */
@Service
public class OrdersServiceImpl implements OrdersService {

    @Autowired
    private OrdersMapper ordersMapper;

    @Override
    public List<Orders> selectOrderByUserId(int userId) {
        return ordersMapper.selectOrderByUserId(userId);
    }

    @Override
    public List<Orders> selectOrderByPhone(String phone, String startTime) {
        return ordersMapper.selectOrderByPhone(phone, startTime);
    }

    @Override
    public int addOrder(Orders order) {
        return ordersMapper.addOrder(order);
    }

    @Override
    public int updatePayStatus(int id, int payStatus) {
        return ordersMapper.updatePayStatus(id, payStatus);
    }

    @Override
    public int updatePayStatusByOrder(String orderNo, int payStatus) {
        return ordersMapper.updatePayStatusByOrder(orderNo, payStatus);
    }
}
